Frontend Forever App
We have a mobile app for you to download and use. And you can unlock many features in the app.
Get it now
Intall Later
Run
HTML
CSS
Javascript
Output
Document
@charset "UTF-8"; @import url(https://fonts.googleapis.com/css?family=Nunito+Sans:300,400,600,700,800); *, :after, :before { box-sizing: border-box; padding: 0; margin: 0; } html, body { height: 100%; } body { margin: 0; padding: 0; background: #111 url(https://labs.phaser.io/assets/sprites/phaser3-logo-small.png) no-repeat 0 20px; color: #eee; font: caption; } #version { position: absolute; left: 0; top: 0; padding: 0; background: rgba(0, 0, 0, 0.5) }
console.log("Event Fired") /* global colors, Phaser */ class Example extends Phaser.Scene { preload() { this.load.image("bg", "assets/tweens/sky.png"); this.load.atlas( "match3", "assets/atlas/match3.png", "assets/atlas/match3.json" ); } create() { this.add.image(400, 300, "bg"); const emitter = this.add.particles(400, 300, "match3", { alpha: { start: 1, end: 0, ease: "Expo.easeIn" }, frame: "Match3_Icon_32", frequency: 20, lifespan: { min: 2000, max: 4000 }, rotate: { onUpdate: (particle, key, t) => 360 * t }, scale: { start: 0, end: 0.4, ease: "Cubic.easeOut", random: true }, speed: 40, }); this.tweens.add({ targets: emitter, speed: 200, duration: 2000, yoyo: true, repeat: -1, ease: "Cubic.easeInOut" }); } } document.getElementById("version").textContent = `Phaser v${Phaser.VERSION}`; new Phaser.Game({ type: Phaser.AUTO, width: 800, height: 600, scene: Example, loader: { baseURL: "https://labs.phaser.io", crossOrigin: "anonymous" } });